from datetime import datetime

from sqlalchemy import Column, Integer, String, DateTime

from config.database import Base


class KylinFutureStrategyInstance(Base):
    """
    期货策略实例表
    """

    __tablename__ = 'kylin_future_strategy_instance'
    id = Column(Integer, primary_key=True, autoincrement=True, comment='策略实例id')
    server = Column(String(50), nullable=False, comment='服务器')
    group = Column(String(50), nullable=False, comment='组名')
    instance = Column(String(50), nullable=False, comment='实例名')
    class_name = Column(String(100), nullable=False, comment='类名')
    vt_symbol = Column(String(50), nullable=False, comment='合约代码')
    create_time = Column(DateTime, default=datetime.now, comment='创建时间')
    update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')